
# In[]
import cv2

img = cv2.imread('/Users/wangxi/Desktop/ML_Study/openCV/第一章计算机视觉引论/lena.jpg')
imageGauss = cv2.GaussianBlur(img,(5,5),0)
image1 = cv2.resize(img,(int(img.shape[1]/2),int(img.shape[0]/2)))
image2 = cv2.pyrDown(image1)
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
_,gray1 = cv2.threshold(gray,120,0xff,cv2.THRESH_BINARY)
cv2.imshow('source image',img)
cv2.imshow('Gaussian filtered image',imageGauss)
cv2.imshow('half size',image1)
cv2.imshow('quarter siee',image2)
cv2.imshow('gray',gray)
cv2.imshow('threshold image',gray1)
cv2.waitKey()
cv2.destroyAllWindows()  